<?

$mois_l= array("","Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","D&eacute;cembre");
$jour_l=array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");

if(!isset($_REQUEST["ts"])){
	if(!isset($_SESSION["calendrier_ts"])) $ts=time();
	else $ts=$_SESSION["calendrier_ts"];
}else{
	$ts=$_REQUEST["ts"];
	$_SESSION["calendrier_ts"]=$_REQUEST["ts"];
}

$nb_jours=date("t",$ts);

switch(date("w",mktime(0,0,0,date("n",$ts),1,date("Y",$ts)))){
	case 0: $jour_deb=6; break;
	case 1: $jour_deb=0; break;
	case 2: $jour_deb=1; break;
	case 3: $jour_deb=2; break;
	case 4: $jour_deb=3; break;
	case 5: $jour_deb=4; break;
	case 6: $jour_deb=5; break;
}

$childs=get_children('calendrier');

function getEvents($ts){
	global $sql,$childs;
	
	$events=array();

	foreach($childs as $child){
		$str=$child."_getEvents(".$ts.",\$events);";
		eval($str);
	}
	
	
	return $events;
}